@import com.mgfireworks.mgplatform.mgadmin.product.model.Category
@extends("/form_template",title=(isEdit?"修改产品类别":"添加产品类别"))
@args Boolean isEdit
@args Category category
@{
	if(category==null){
		category=new Category();
	}
}
<div class="x_content">
   <input type="hidden" name="parentId" value="@category.getParentId()"/>
   <f_input name="parentName" text="所属类别" value="@category.getParentName()" readonly="readonly"></f_input>
   <input type="hidden" name="cateId" value="@category.getCateId()"/>
   <f_input name="cateName" text="类别名称" value="@category.getCateName()"></f_input>

    <div class="form-group">
        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="cateImg">类别图片</label>
        <div class="col-md-6 col-sm-6 col-xs-12">
            <img class="product-cate-img" src="@url("")@category.getCateImg()"/>
            <div class="x_panel">
                <div class="x_title collapse-link">
                    <button type="button" class="btn btn-primary btn-sm">上传图片</button>
                    <ul class="nav navbar-right panel_toolbox">
                        <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
                    </ul>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content" style="display: none;">
                    <input type="text" name="cateImg" value="@category.getCateImg()" required="required" readonly="readonly" class="form-control col-md-7 col-xs-12">
                    <div id="jsCateImgUpload" class="dropzone dz-clickable dz-started uploader-img"></div>
                </div>
            </div>

        </div>
    </div>
</div>
@section(script){
    <script type="text/javascript">
        $(function(){
            //准备图片上传控件
            preparedUploadController("#jsCateImgUpload",1,2);
        });
    </script>
}